﻿using System;
using System.Collections.Generic;
using System.Text;
using DomainComponents.Common;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using System.ComponentModel;
using DevExpress.ExpressApp;

namespace DomainComponents.XCRM {
    [DomainComponent]
    [ImageName("BO_Scheduler")]
    public interface IActivity : IPersistentEvent {
        IDCUser Owner { get; set; }
        IActivityTarget Regarding { get; set; }
    }

    [DomainComponent]
    public interface IActivityTarget {
        [PersistentDc]
        [VisibleInListView(false), VisibleInDetailView(false)]
        string DisplayName { get; }

        [BackReferenceProperty("Regarding")]
        IList<IActivity> Activities { get; }
    }

    [DomainLogic(typeof(IActivityTarget))]
    public class ActivityTargetLogic {
        public static string Get_DisplayName(IActivityTarget obj) {
            return ReflectionHelper.GetObjectDisplayText(obj);
        }
    }
}
